import React, { Component } from 'react'
import LeftMenu from "../LeftMenu";
import {Layout, Menu, Breadcrumb, Icon} from 'antd';
import '../style/admin.less';
import {Route, Switch, Link, Redirect} from 'react-router-dom';
const {Header, Content, Sider} = Layout;
export default (props) => {
    const { menuList, routers } = props;
   return (
    <Layout theme="dark" className="mainLayout">
    <Header>头部信息</Header>
    <Layout className="mainContainer">
      <Sider>
          <LeftMenu child={menuList}/>
      </Sider>
      <Content className="rightContainer">
        <Switch>
          {routers.map ((route, index) => (
            <Route
              key={index}
              path={route.path}
              exact={route.exact}
              component={route.render}
            />
          ))}
          <Redirect from="/" to={routers[0].path} />
        </Switch>
      </Content>
    </Layout>
  </Layout>
   )
}
